﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace OnlineMealOrdering.Domain.Base
{
    /// <summary>
    /// Interface for auditable entities by which determinate whether need to inject the Created User and Updated User or not when persisting.
    /// If a entity implemented <see cref="IAuditable"/>, persistence model will automatically fill the auditing infomation including CreatedBy, CreatedDate,UpdatedBy,UpdatedDate. 
    /// </summary>
    public interface IAuditable
    {
        /// <summary>
        /// User who create the entity
        /// </summary>
        UserEntity CreatedBy { get; set; }

        /// <summary>
        /// Date when create the entity
        /// </summary>
        DateTime CreatedDate { get; set; }

        /// <summary>
        /// User who update the entity
        /// </summary>
        UserEntity UpdatedBy { get; set; }

        /// <summary>
        /// Date when update the entity
        /// </summary>
        DateTime UpdatedDate { get; set; }
    }
}
